import type { FormsItem } from './test-forms.d.ts'
function mockData(): Promise<FormsItem[]> {
  const list: FormsItem[] = [
    {
      tag: 'el-input',
      name: 'name',
      label: '名称',
      span: 8
    },
    {
      label: '学校',
      slot: 'school',
      name: 'school',
      span: 16
    },
    {
      tag: 'el-input',
      label: '省份',
      labelSlot: 'provinceSlot',
      name: 'province',
      span: 16
    },
    {
      tag: 'testSelect',
      name: 'status',
      label: '状态',
      span: 8,
      options: [
        {
          label: 'active',
          value: 'active'
        },
        {
          label: 'inactive',
          value: 'inactive'
        }
      ]
    },
    {
      tag: 'testSelect',
      name: 'gender',
      label: '性别',
      span: 8,
      options: [
        {
          label: '男',
          value: 'nan'
        },
        {
          label: '女',
          value: 'nv'
        }
      ]
    },
    {
      tag: 'el-input',
      name: 'project',
      label: '项目',
      span: 8
    },
    {
      tag: 'el-input',
      name: 'department',
      label: '部门',
      span: 8
    },
    {
      slot: 'footer'
    }
  ]
  const wait = Math.ceil(Math.random() * 3000)
  return new Promise((resolve) => {
    setTimeout(() => {
      resolve(list)
    }, wait)
  })
}

export { mockData }
